1. Field of the Invention
The present invention relates to the field of image recognition. More specifically, the present invention relates to a method and apparatus for partitioning an object from an image.
2. Description of the Related Art
In the field of machine vision based vehicle recognition systems, when recognizing a vehicle captured in an image taken by an image pickup device, such as a camera installed on a vehicle or other moving or fixed object, a region containing the vehicle (also referred to as ROI, or region of interest) is partitioned from the image. The vehicle is then recognized based on the partitioned region.
One of the most common techniques used to recognize vehicles in a partitioned image involves the use of a vehicle's shadow. All vehicles will cast a shadow when exposed to light, regardless of the shape or size of the vehicle. Thus, the shadow underneath a vehicle is an important feature for partitioning a region containing a vehicle from an image when using machine vision based vehicle image partitioning technology.
In the prior art, there are generally two methods used to partition a region containing a vehicle from an image based on the shadow underneath the vehicle. In the first method, the average gray scale value of the road surface in the image is calculated by recognizing that the gray scale value of the shadow underneath the vehicle is darker than the road surface. Next, using the average gray scale value of the road surface, all the regions with gray degree values lower than the average gray scale value are extracted as regions of the shadow underneath a vehicle. The region containing the vehicle is then partitioned using the regions corresponding to the shadow underneath the vehicle. In the second method, regions that are partially darker than their surroundings are extracted from an image as regions of the shadow underneath the vehicle. This is done because the region containing the shadow underneath the vehicle is always darker than the surrounding regions. The region containing the vehicle is then partitioned using the regions corresponding to the shadow underneath the vehicle. This method is described in detail in Japanese patent document 2003-76987 and in Chinese Patent Publication No. CN101030256A filed in Mar. 17, 2006, the entirety of which are hereby incorporated by reference.
Due to the significant role the shadow underneath a vehicle plays in the art of vehicle image partitioning, the shadow underneath a vehicle has a significant effect on whether the region containing a vehicle can be partitioned from the image correctly. In some cases, the angle of incidence of light may cause the shadow underneath the vehicle to be incomplete. That is to say, the direction of the light source may affect the vehicle's shadow such that the shadow does not correspond to the actual dimensions or location of the vehicle. In this case, when the region containing the vehicle is partitioned from an image based on the shadow underneath the vehicle, the partitioned region only includes a portion of the vehicle, as shown in FIGS. 1-4. In other cases, if multiple vehicles are captured in the same image, the direction of the light source may cause the shadow underneath one vehicle to be combined with the shadow underneath another vehicle in the image. In this case, if the region partitioned from the image is based on the shadow underneath a vehicle, the partitioned region may comprise features of two or more vehicles, as shown in FIGS. 5-6.
In the case where the shadow is incomplete, the recognition system cannot recognize the vehicle correctly based on the partitioned region because the partitioned region does not include the entire vehicle. In the case where the shadows of two or more vehicles are combined, the recognition system may leave one of the vehicles unrecognized or incorrectly recognize multiple vehicles as one vehicle when determining the partitioned region. In both cases, the vehicle recognition system is unable to recognize the vehicle contained in the partitioned region correctly.
The problems mentioned above apply to machine-vision based vehicle recognition systems, as well as machine-vision based systems for recognizing objects such as pedestrians.